package com.devsoft.foodfrenzy;

import java.io.IOException;

import org.andengine.audio.music.Music;
import org.andengine.audio.music.MusicFactory;
import org.andengine.audio.sound.Sound;
import org.andengine.audio.sound.SoundFactory;
import org.andengine.engine.Engine;
import org.andengine.engine.camera.Camera;
import org.andengine.opengl.font.Font;
import org.andengine.opengl.font.FontFactory;
import org.andengine.opengl.texture.ITexture;
import org.andengine.opengl.texture.TextureOptions;
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas;
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlasTextureRegionFactory;
import org.andengine.opengl.texture.atlas.bitmap.BuildableBitmapTextureAtlas;
import org.andengine.opengl.texture.atlas.bitmap.source.IBitmapTextureAtlasSource;
import org.andengine.opengl.texture.atlas.buildable.builder.BlackPawnTextureAtlasBuilder;
import org.andengine.opengl.texture.atlas.buildable.builder.ITextureAtlasBuilder.TextureAtlasBuilderException;
import org.andengine.opengl.texture.region.ITextureRegion;
import org.andengine.opengl.texture.region.ITiledTextureRegion;
import org.andengine.opengl.vbo.VertexBufferObjectManager;
import org.andengine.util.debug.Debug;
import android.graphics.Color;

public class ResourcesManager
{
    private static final ResourcesManager INSTANCE = new ResourcesManager();
    
    public Engine engine;								//resource manager variables
    public GameActivity activity;
    public Camera camera;
    public VertexBufferObjectManager vbom;
    
    //---------------------------------------------
    // TEXTURES & TEXTURE REGIONS
    //---------------------------------------------
    
    public ITextureRegion splash_region;					//splash screen variables
    private BitmapTextureAtlas splashTextureAtlas;
    
    public ITextureRegion soon_region;					//"Coming Soon" screen variables
    private BuildableBitmapTextureAtlas soonTextureAtlas;
    
    public ITextureRegion title_background_region;					//title screen variables
    public ITiledTextureRegion tap_animation_region;
    private BuildableBitmapTextureAtlas titleTextureAtlas;
    
    public ITextureRegion credits_background_region;					//credits screen variables
    public ITextureRegion square_region;
    private BuildableBitmapTextureAtlas creditsTextureAtlas;
    
    public ITextureRegion menu_background_region;			//main menu variables
    public ITextureRegion singleplayer_region;
    public ITextureRegion multiplayer_region;
    public ITextureRegion options_region;
    public ITextureRegion achievements_region;
    public ITextureRegion info_region;
    public ITextureRegion credits_region;
    private BuildableBitmapTextureAtlas menuTextureAtlas;
    
    public ITextureRegion sp_menu_background_region;		//singleplayer menu variables
    public ITextureRegion arcade_region;
    public ITextureRegion classic_region;
    private BuildableBitmapTextureAtlas SPTextureAtlas;
    
    public ITextureRegion mp_menu_background_region;		//multiplayer menu variables
    public ITextureRegion creategame_region;
    public ITextureRegion joingame_region;
    private BuildableBitmapTextureAtlas MPTextureAtlas;
    
    public ITextureRegion opt_right_region;						//options variables
    public ITextureRegion opt_left_region;
    public ITextureRegion options_background_region;
    private BuildableBitmapTextureAtlas optionsTextureAtlas;
    
    public ITextureRegion again_region;						//game over variables
    public ITextureRegion back_region;
    public ITextureRegion nhs_region;
    public ITextureRegion nau_region;
    public ITextureRegion nsu_region;
    public ITextureRegion gameover_background_region;
    private BuildableBitmapTextureAtlas gameoverTextureAtlas;
 
    public ITextureRegion playerinfo_background_region;
    public ITiledTextureRegion player_skin_region;
    public ITextureRegion pi_back_region;
    public ITextureRegion pi_reset_region;
    public ITextureRegion pi_next_region;
    public ITextureRegion pi_yes_region;
    public ITextureRegion pi_no_region;
    public ITextureRegion pi_warning_region;
    private BuildableBitmapTextureAtlas playerinfoTextureAtlas;
    
    public ITextureRegion achievements_background_region;	//achievements variables
    public ITextureRegion right_region;
    public ITextureRegion left_region;
    public ITextureRegion information_region;
    public ITextureRegion ok_region;
    public ITextureRegion popup_region;
    public ITiledTextureRegion achievement_region;
    public ITiledTextureRegion achievement_region_0;
    public ITiledTextureRegion achievement_region_1;
    public ITiledTextureRegion achievement_region_2;
    public ITiledTextureRegion achievement_region_3;
    public ITiledTextureRegion achievement_region_4;
    public ITiledTextureRegion achievement_region_5;
    public ITiledTextureRegion achievement_region_6;
    public ITiledTextureRegion achievement_region_7;
    public ITiledTextureRegion achievement_region_8;
    public ITiledTextureRegion achievement_region_9;
    private BuildableBitmapTextureAtlas achievementsTextureAtlas;
    
    public Font font;										//font for loading screen
    public Font big_font;
    public Font small_font;
    public Font opt_font;
    
    public ITiledTextureRegion food_bananas_region;				//game texture variables
    public ITiledTextureRegion food_bellpepper_region;
    public ITiledTextureRegion food_burger_region;	
    public ITiledTextureRegion food_carrot_region;	
    public ITiledTextureRegion food_cherry_region;	
    public ITiledTextureRegion food_chicken_region;	
    public ITiledTextureRegion food_corndog_region;	
    public ITiledTextureRegion food_donut_region;	
    public ITiledTextureRegion food_egg_region;	
    public ITiledTextureRegion food_eggplant_region;	
    public ITiledTextureRegion food_grapes_region;	
    public ITiledTextureRegion food_lemon_region;	
    public ITiledTextureRegion food_mushroom_region;	
    public ITiledTextureRegion food_pineapple_region;	
    public ITiledTextureRegion food_strawberry_region;	
    public ITiledTextureRegion food_sushi_region;	
    public ITiledTextureRegion food_tomato_region;	
    public ITiledTextureRegion food_watermelon_region;
    public ITextureRegion powerup1;	
    public ITextureRegion powerup2;	
    public ITextureRegion powerup3;	
    public ITextureRegion powerup4;
    public ITextureRegion powerupblank;
    public ITiledTextureRegion poweruphud;
    public ITiledTextureRegion player;
    public ITiledTextureRegion pan;
    public ITiledTextureRegion double_pan;
    public ITiledTextureRegion animation;
    public ITextureRegion game_background_region;
    public BuildableBitmapTextureAtlas gameTextureAtlas;
    
    public Music main_menu_music;
    public Music game_music;
    public Sound game_cook;
    public Sound game_powerup;
    public Sound game_flip;
    public Sound game_walk;
    public Music game_countdown;
    public Music game_gameover;
    public Music ff_intro;
    

    //---------------------------------------------
    //	CLASS LOGIC
    //---------------------------------------------
    
    public void loadMenuResources()
    {
        loadMenuGraphics();
    }
    
    
    public void loadSPMenuResources()
    {
        loadSPMenuGraphics();
    }
    
    
    public void loadMPGameResources()
    {
    	loadMPGameGraphics();
    }
    
    
    public void loadOptionsResources()
    {
        loadOptionsGraphics();
    }
    
    public void loadGameOverResources()
    {
        loadGameOverGraphics();
    }
    
    public void loadPlayerInfoResources()
    {
        loadPlayerInfoGraphics();
    }
    
    public void loadSoonResources()
    {
        loadSoonGraphics();
    }
    
    public void loadTitleResources()
    {
        loadTitleGraphics();
        loadAudio();
        loadFonts();
    }
    
    public void loadCreditsResources()
    {
        loadCreditsGraphics();
    }
    
    public void loadAchievementsResources()
    {
    	loadAchievementsGraphics();
    }
    
    
    public void loadGameResources()
    {
        loadGameGraphics();
    }
    
    
    private void loadMenuGraphics()
    {
    	BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/menu/");
    	menuTextureAtlas = new BuildableBitmapTextureAtlas(activity.getTextureManager(), 4096, 4096, TextureOptions.BILINEAR);
    	menu_background_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(menuTextureAtlas, activity, "main_menu.png");
    	singleplayer_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(menuTextureAtlas, activity, "singleplayer_button.png");
    	multiplayer_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(menuTextureAtlas, activity, "multiplayer_button.png");
    	options_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(menuTextureAtlas, activity, "options_button.png");
    	achievements_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(menuTextureAtlas, activity, "achievements_button.png");
    	info_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(menuTextureAtlas, activity, "playerinfo_button.png");
    	credits_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(menuTextureAtlas, activity, "credits_button.png");
    	
    	try 
    	{
    	    this.menuTextureAtlas.build(new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(0, 1, 0));
    	    this.menuTextureAtlas.load();
    	    
    	} 
    	catch (final TextureAtlasBuilderException e)
    	{
    	        Debug.e(e);
    	        
    	}
        
    }
    
    
    private void loadSPMenuGraphics()
    {
    	BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/menu/");
    	SPTextureAtlas = new BuildableBitmapTextureAtlas(activity.getTextureManager(), 1024, 1024, TextureOptions.BILINEAR);
    	sp_menu_background_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(SPTextureAtlas, activity, "singleplayer_menu.png");
    	arcade_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(SPTextureAtlas, activity, "arcade_button.png");
    	classic_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(SPTextureAtlas, activity, "classic_button.png");
    	       
    	try 
    	{
    	    this.SPTextureAtlas.build(new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(0, 1, 0));
    	    this.SPTextureAtlas.load();
    	    
    	} 
    	catch (final TextureAtlasBuilderException e)
    	{
    	        Debug.e(e);
    	        
    	}
        
    }
    
    
    private void loadMPGameGraphics()
    {
    
    	MPTextureAtlas = new BuildableBitmapTextureAtlas(activity.getTextureManager(), 4096, 4096, TextureOptions.BILINEAR);
    	
    	BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/menu/");
    	creategame_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(MPTextureAtlas, activity, "creategame_button.png");
    	joingame_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(MPTextureAtlas, activity, "joingame_button.png");
    	
    	BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/game/");
    	food_bananas_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(MPTextureAtlas, activity, "food/food_bananas_animated_v2.png",3,1);
    	food_bellpepper_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(MPTextureAtlas, activity, "food/food_bellpepper_animated_v2.png",3,1);
    	food_burger_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(MPTextureAtlas, activity, "food/food_burger_animated_v2.png",3,1);	
        food_carrot_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(MPTextureAtlas, activity, "food/food_carrot_animated_v2.png",3,1);	
        food_cherry_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(MPTextureAtlas, activity, "food/food_cherry_animated_v2.png",3,1);	
        food_chicken_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(MPTextureAtlas, activity, "food/food_chicken_animated_v2.png",3,1);	
        food_corndog_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(MPTextureAtlas, activity, "food/food_corndog_animated_v2.png",3,1);	
        food_donut_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(MPTextureAtlas, activity, "food/food_donut_animated_v2.png",3,1);	
        food_egg_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(MPTextureAtlas, activity, "food/food_egg_animated_v2.png",3,1);	
        food_eggplant_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(MPTextureAtlas, activity, "food/food_eggplant_animated_v2.png",3,1);	
        food_grapes_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(MPTextureAtlas, activity, "food/food_grapes_animated_v2.png",3,1);	
        food_lemon_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(MPTextureAtlas, activity, "food/food_lemon_animated_v2.png",3,1);	
        food_mushroom_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(MPTextureAtlas, activity, "food/food_mushroom_animated_v2.png",3,1);	
        food_pineapple_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(MPTextureAtlas, activity, "food/food_pineapple_animated_v2.png",3,1);	
        food_strawberry_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(MPTextureAtlas, activity, "food/food_strawberry_animated_v2.png",3,1);	
        food_sushi_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(MPTextureAtlas, activity, "food/food_sushi_animated_v2.png",3,1);	
        food_tomato_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(MPTextureAtlas, activity, "food/food_tomato_animated_v2.png",3,1);	
        food_watermelon_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(MPTextureAtlas, activity, "food/food_watermelon_animated_v2.png",3,1);
        powerup1 = BitmapTextureAtlasTextureRegionFactory.createFromAsset(MPTextureAtlas, activity, "power_ups/power_up_instantcook.png");
        powerup2 = BitmapTextureAtlasTextureRegionFactory.createFromAsset(MPTextureAtlas, activity, "power_ups/power_up_multiplier.png");
        powerup3 = BitmapTextureAtlasTextureRegionFactory.createFromAsset(MPTextureAtlas, activity, "power_ups/power_up_life.png");
        powerup4 = BitmapTextureAtlasTextureRegionFactory.createFromAsset(MPTextureAtlas, activity, "power_ups/power_up_helpinghand.png");
        powerupblank = BitmapTextureAtlasTextureRegionFactory.createFromAsset(MPTextureAtlas, activity, "power_ups/power_up_blank.png");
        poweruphud = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(MPTextureAtlas, activity, "power_ups/powerup_hud.png", 5, 1);
        pan = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(MPTextureAtlas, activity, "player/pan_v2.png", 2, 1);
        double_pan = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(MPTextureAtlas, activity, "player/double_pan_v2.png", 2, 1);
        animation = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(MPTextureAtlas, activity, "start_animation_v4.png", 2, 3);
        
        if (UserData.getInstance().getSkinPref() == 10)
        {
        	game_background_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(MPTextureAtlas, activity, "game_background_space.png");
        }
        else if (UserData.getInstance().getSkinPref() == 15)
        {
        	game_background_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(MPTextureAtlas, activity, "game_background_picnic.png");
        }
        else
        {
        	game_background_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(MPTextureAtlas, activity, "game_background.png");
        }
        
    	switch(UserData.getInstance().getSkinPref()){
    		case 0:
    			player = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(MPTextureAtlas, activity, "player/panda_chef_animated_v5.png", 4, 1);
    			break;
    		case 1:
    			player = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(MPTextureAtlas, activity, "player/panda_chef_skin_animated_v5.png", 4, 1);
        		break;
    		case 2:
    			player = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(MPTextureAtlas, activity, "player/panda_chef_skin_1_animated_v5.png", 4, 1);
        		break;
    		case 3:
    			player = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(MPTextureAtlas, activity, "player/panda_chef_skin_2_animated_v5.png", 4, 1);
        		break;
    		case 4:
    			player = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(MPTextureAtlas, activity, "player/panda_chef_skin_3_animated_v5.png", 4, 1);
        		break;
    		case 5:
    			player = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(MPTextureAtlas, activity, "player/panda_chef_skin_4_animated_v5.png", 4, 1);
        		break;
    		case 6:
    			player = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(MPTextureAtlas, activity, "player/panda_chef_skin_5_animated_v5.png", 4, 1);
        		break;
    		case 7:
    			player = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(MPTextureAtlas, activity, "player/panda_chef_skin_6_animated_v5.png", 4, 1);
        		break;
    		case 8:
    			player = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(MPTextureAtlas, activity, "player/panda_chef_skin_7_animated_v5.png", 4, 1);
        		break;
    		case 9:
    			player = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(MPTextureAtlas, activity, "player/panda_chef_skin_8_animated_v5.png", 4, 1);
        		break;
    		case 10:
    			player = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(MPTextureAtlas, activity, "player/panda_chef_skin_9_animated_v5.png", 4, 1);
        		break;
    		case 11:
    			player = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(MPTextureAtlas, activity, "player/panda_chef_skin_10_animated_v5.png", 4, 1);
        		break;
    		case 12:
    			player = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(MPTextureAtlas, activity, "player/panda_chef_skin_11_animated_v5.png", 4, 1);
        		break;
    		case 13:
    			player = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(MPTextureAtlas, activity, "player/panda_chef_skin_12_animated_v5.png", 4, 1);
        		break;
    		case 14:
    			player = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(MPTextureAtlas, activity, "player/panda_chef_skin_13_animated_v5.png", 4, 1);
        		break;
    		case 15:
    			player = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(MPTextureAtlas, activity, "player/panda_chef_skin_14_animated_v5.png", 4, 1);
        		break;
    	}
    	
        try 
    	{
    	    this.MPTextureAtlas.build(new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(0, 1, 0));
    	    this.MPTextureAtlas.load();
    	    
    	} 
    	catch (final TextureAtlasBuilderException e)
    	{
    	        Debug.e(e);
    	        
    	}
    }
    
    
    private void loadOptionsGraphics()
    {
    	BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/menu/");
    	optionsTextureAtlas = new BuildableBitmapTextureAtlas(activity.getTextureManager(), 1024, 1024, TextureOptions.BILINEAR);
    	options_background_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(optionsTextureAtlas, activity, "options_menu.png");
    	opt_right_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(optionsTextureAtlas, activity, "right_arrow.png");
    	opt_left_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(optionsTextureAtlas, activity, "left_arrow.png");

    	try 
    	{
    	    this.optionsTextureAtlas.build(new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(0, 1, 0));
    	    this.optionsTextureAtlas.load();
    	    
    	} 
    	catch (final TextureAtlasBuilderException e)
    	{
    	        Debug.e(e);
    	        
    	}
        
    }
    
    private void loadGameOverGraphics()
    {
    	BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/menu/");
    	gameoverTextureAtlas = new BuildableBitmapTextureAtlas(activity.getTextureManager(), 1024, 1024, TextureOptions.BILINEAR);
    	gameover_background_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(gameoverTextureAtlas, activity, "game_over.png");
    	again_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(gameoverTextureAtlas, activity, "again_button.png");
    	back_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(gameoverTextureAtlas, activity, "back_button.png");
    	nhs_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(gameoverTextureAtlas, activity, "nhs_image_v2.png");
        nau_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(gameoverTextureAtlas, activity, "nau_image_v2.png");
        nsu_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(gameoverTextureAtlas, activity, "nsu_image_v2.png");
        
    	try 
    	{
    	    this.gameoverTextureAtlas.build(new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(0, 1, 0));
    	    this.gameoverTextureAtlas.load();
    	    
    	} 
    	catch (final TextureAtlasBuilderException e)
    	{
    	        Debug.e(e);
    	        
    	}
        
    }
    
    private void loadPlayerInfoGraphics()
    {
    	BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/menu/");
    	playerinfoTextureAtlas = new BuildableBitmapTextureAtlas(activity.getTextureManager(), 1780, 1780, TextureOptions.BILINEAR);
    	playerinfo_background_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(playerinfoTextureAtlas, activity, "playerinfo_menu_opt.png");
    	player_skin_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(playerinfoTextureAtlas, activity, "all_skins_heads_v3.png",8,2);
    	pi_back_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(playerinfoTextureAtlas, activity, "back.png");
        pi_reset_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(playerinfoTextureAtlas, activity, "reset.png");
        pi_next_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(playerinfoTextureAtlas, activity, "next.png");
        pi_yes_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(playerinfoTextureAtlas, activity, "yes.png");
        pi_no_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(playerinfoTextureAtlas, activity, "no.png");
        pi_warning_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(playerinfoTextureAtlas, activity, "warning.png");

    	try 
    	{
    	    this.playerinfoTextureAtlas.build(new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(0, 1, 0));
    	    this.playerinfoTextureAtlas.load();
    	    
    	} 
    	catch (final TextureAtlasBuilderException e)
    	{
    	        Debug.e(e);
    	        
    	}
        
    }
    
    private void loadSoonGraphics()
    {
    	BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/menu/");
    	soonTextureAtlas = new BuildableBitmapTextureAtlas(activity.getTextureManager(), 1024, 1024, TextureOptions.BILINEAR);
    	soon_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(soonTextureAtlas, activity, "coming_soon.png");
    	back_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(soonTextureAtlas, activity, "back_button.png");
    	       
    	try 
    	{
    	    this.soonTextureAtlas.build(new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(0, 1, 0));
    	    this.soonTextureAtlas.load();
    	    
    	} 
    	catch (final TextureAtlasBuilderException e)
    	{
    	        Debug.e(e);
    	        
    	}
        
    }
    
    private void loadTitleGraphics()
    {
    	BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/menu/");
    	titleTextureAtlas = new BuildableBitmapTextureAtlas(activity.getTextureManager(), 1024, 1024, TextureOptions.BILINEAR);
    	title_background_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(titleTextureAtlas, activity, "title_screen.png");
    	tap_animation_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(titleTextureAtlas, activity, "title_screen_animation.png", 1, 2);
    	
    	try 
    	{
    	    this.titleTextureAtlas.build(new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(0, 1, 0));
    	    this.titleTextureAtlas.load();
    	    
    	} 
    	catch (final TextureAtlasBuilderException e)
    	{
    	        Debug.e(e);
    	        
    	}
        
    }
    
    private void loadCreditsGraphics()
    {
    	BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/menu/");
    	creditsTextureAtlas = new BuildableBitmapTextureAtlas(activity.getTextureManager(), 1024, 1024, TextureOptions.BILINEAR);
    	credits_background_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(creditsTextureAtlas, activity, "credits_screen.png");
    	square_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(creditsTextureAtlas, activity, "secret_code_square.png");
    	       
    	try 
    	{
    	    this.creditsTextureAtlas.build(new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(0, 1, 0));
    	    this.creditsTextureAtlas.load();
    	    
    	} 
    	catch (final TextureAtlasBuilderException e)
    	{
    	        Debug.e(e);
    	        
    	}
        
    }
    
    private void loadAchievementsGraphics()
    {
    	BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/menu/");
    	achievementsTextureAtlas = new BuildableBitmapTextureAtlas(activity.getTextureManager(), 4096, 4096, TextureOptions.BILINEAR);
    	achievements_background_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(achievementsTextureAtlas, activity, "achievements_menu.png");
    	right_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(achievementsTextureAtlas, activity, "right_arrow.png");
    	left_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(achievementsTextureAtlas, activity, "left_arrow.png");
    	information_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(achievementsTextureAtlas, activity, "info_button.png");
    	ok_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(achievementsTextureAtlas, activity, "ok_button.png");
    	popup_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(achievementsTextureAtlas, activity, "popup.png");
    	achievement_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(achievementsTextureAtlas, activity, "achievement_sheet.png", 4, 1);
    	achievement_region_0 = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(achievementsTextureAtlas, activity, "achievement0_sheet.png", 4, 1);
    	achievement_region_1 = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(achievementsTextureAtlas, activity, "achievement1_sheet.png", 4, 1);
    	achievement_region_2 = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(achievementsTextureAtlas, activity, "achievement2_sheet.png", 4, 1);
    	achievement_region_3 = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(achievementsTextureAtlas, activity, "achievement3_sheet.png", 4, 1);
    	achievement_region_4 = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(achievementsTextureAtlas, activity, "achievement4_sheet.png", 4, 1);
    	achievement_region_5 = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(achievementsTextureAtlas, activity, "achievement5_sheet.png", 4, 1);
    	achievement_region_6 = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(achievementsTextureAtlas, activity, "achievement6_sheet.png", 4, 1);
    	achievement_region_7 = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(achievementsTextureAtlas, activity, "achievement7_sheet.png", 4, 1);
    	achievement_region_8 = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(achievementsTextureAtlas, activity, "achievement8_sheet.png", 4, 1);
    	achievement_region_9 = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(achievementsTextureAtlas, activity, "achievement9_sheet.png", 4, 1);
     
    	try 
    	{
    	    this.achievementsTextureAtlas.build(new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(0, 1, 0));
    	    this.achievementsTextureAtlas.load();
    	    
    	} 
    	catch (final TextureAtlasBuilderException e)
    	{
    	        Debug.e(e);
    	        
    	}
    }
    
    
    private void loadGameGraphics()
    {
    	BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/game/");
    	
    	gameTextureAtlas = new BuildableBitmapTextureAtlas(activity.getTextureManager(), 2048, 1024, TextureOptions.BILINEAR);	//sets texture palette dimensions (800 x 480)
    	food_bananas_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(gameTextureAtlas, activity, "food/food_bananas_animated_v2.png",3,1);
    	food_bellpepper_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(gameTextureAtlas, activity, "food/food_bellpepper_animated_v2.png",3,1);
    	food_burger_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(gameTextureAtlas, activity, "food/food_burger_animated_v2.png",3,1);	
        food_carrot_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(gameTextureAtlas, activity, "food/food_carrot_animated_v2.png",3,1);	
        food_cherry_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(gameTextureAtlas, activity, "food/food_cherry_animated_v2.png",3,1);	
        food_chicken_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(gameTextureAtlas, activity, "food/food_chicken_animated_v2.png",3,1);	
        food_corndog_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(gameTextureAtlas, activity, "food/food_corndog_animated_v2.png",3,1);	
        food_donut_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(gameTextureAtlas, activity, "food/food_donut_animated_v2.png",3,1);	
        food_egg_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(gameTextureAtlas, activity, "food/food_egg_animated_v2.png",3,1);	
        food_eggplant_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(gameTextureAtlas, activity, "food/food_eggplant_animated_v2.png",3,1);	
        food_grapes_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(gameTextureAtlas, activity, "food/food_grapes_animated_v2.png",3,1);	
        food_lemon_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(gameTextureAtlas, activity, "food/food_lemon_animated_v2.png",3,1);	
        food_mushroom_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(gameTextureAtlas, activity, "food/food_mushroom_animated_v2.png",3,1);	
        food_pineapple_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(gameTextureAtlas, activity, "food/food_pineapple_animated_v2.png",3,1);	
        food_strawberry_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(gameTextureAtlas, activity, "food/food_strawberry_animated_v2.png",3,1);	
        food_sushi_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(gameTextureAtlas, activity, "food/food_sushi_animated_v2.png",3,1);	
        food_tomato_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(gameTextureAtlas, activity, "food/food_tomato_animated_v2.png",3,1);	
        food_watermelon_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(gameTextureAtlas, activity, "food/food_watermelon_animated_v2.png",3,1);
        powerup1 = BitmapTextureAtlasTextureRegionFactory.createFromAsset(gameTextureAtlas, activity, "power_ups/power_up_instantcook.png");
        powerup2 = BitmapTextureAtlasTextureRegionFactory.createFromAsset(gameTextureAtlas, activity, "power_ups/power_up_multiplier.png");
        powerup3 = BitmapTextureAtlasTextureRegionFactory.createFromAsset(gameTextureAtlas, activity, "power_ups/power_up_life.png");
        powerup4 = BitmapTextureAtlasTextureRegionFactory.createFromAsset(gameTextureAtlas, activity, "power_ups/power_up_helpinghand.png");
        powerupblank = BitmapTextureAtlasTextureRegionFactory.createFromAsset(gameTextureAtlas, activity, "power_ups/power_up_blank.png");
        poweruphud = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(gameTextureAtlas, activity, "power_ups/powerup_hud.png", 5, 1);
        pan = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(gameTextureAtlas, activity, "player/pan_v2.png", 2, 1);
        double_pan = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(gameTextureAtlas, activity, "player/double_pan_v2.png", 2, 1);
        animation = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(gameTextureAtlas, activity, "start_animation_v4.png", 2, 3);
        
        if (UserData.getInstance().getSkinPref() == 10)
        {
        	game_background_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(gameTextureAtlas, activity, "game_background_space.png");
        }
        else if (UserData.getInstance().getSkinPref() == 15)
        {
        	game_background_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(gameTextureAtlas, activity, "game_background_picnic.png");
        }
        else
        {
        	game_background_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(gameTextureAtlas, activity, "game_background.png");
        }
        
    	switch(UserData.getInstance().getSkinPref()){
    		case 0:
    			player = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(gameTextureAtlas, activity, "player/panda_chef_animated_v5.png", 4, 1);
    			break;
    		case 1:
    			player = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(gameTextureAtlas, activity, "player/panda_chef_skin_animated_v5.png", 4, 1);
        		break;
    		case 2:
    			player = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(gameTextureAtlas, activity, "player/panda_chef_skin_1_animated_v5.png", 4, 1);
        		break;
    		case 3:
    			player = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(gameTextureAtlas, activity, "player/panda_chef_skin_2_animated_v5.png", 4, 1);
        		break;
    		case 4:
    			player = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(gameTextureAtlas, activity, "player/panda_chef_skin_3_animated_v5.png", 4, 1);
        		break;
    		case 5:
    			player = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(gameTextureAtlas, activity, "player/panda_chef_skin_4_animated_v5.png", 4, 1);
        		break;
    		case 6:
    			player = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(gameTextureAtlas, activity, "player/panda_chef_skin_5_animated_v5.png", 4, 1);
        		break;
    		case 7:
    			player = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(gameTextureAtlas, activity, "player/panda_chef_skin_6_animated_v5.png", 4, 1);
        		break;
    		case 8:
    			player = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(gameTextureAtlas, activity, "player/panda_chef_skin_7_animated_v5.png", 4, 1);
        		break;
    		case 9:
    			player = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(gameTextureAtlas, activity, "player/panda_chef_skin_8_animated_v5.png", 4, 1);
        		break;
    		case 10:
    			player = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(gameTextureAtlas, activity, "player/panda_chef_skin_9_animated_v5.png", 4, 1);
        		break;
    		case 11:
    			player = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(gameTextureAtlas, activity, "player/panda_chef_skin_10_animated_v5.png", 4, 1);
        		break;
    		case 12:
    			player = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(gameTextureAtlas, activity, "player/panda_chef_skin_11_animated_v5.png", 4, 1);
        		break;
    		case 13:
    			player = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(gameTextureAtlas, activity, "player/panda_chef_skin_12_animated_v5.png", 4, 1);
        		break;
    		case 14:
    			player = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(gameTextureAtlas, activity, "player/panda_chef_skin_13_animated_v5.png", 4, 1);
        		break;
    		case 15:
    			player = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(gameTextureAtlas, activity, "player/panda_chef_skin_14_animated_v5.png", 4, 1);
        		break;
    	}
    	
        try 
    	{
    	    this.gameTextureAtlas.build(new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(0, 1, 0));
    	    this.gameTextureAtlas.load();
    	    
    	} 
    	catch (final TextureAtlasBuilderException e)
    	{
    	        Debug.e(e);
    	        
    	}
        
    }
    
    private void loadAudio()
    {
    	MusicFactory.setAssetBasePath("sounds/");
    	SoundFactory.setAssetBasePath("sounds/");
    	
    	try
    	{
    		main_menu_music = MusicFactory.createMusicFromAsset(engine.getMusicManager(), activity,"main_menu_music.ogg");
    	    game_music = MusicFactory.createMusicFromAsset(engine.getMusicManager(), activity,"game_music.ogg");
    	    game_cook = SoundFactory.createSoundFromAsset(engine.getSoundManager(), activity, "cook_sound.ogg");
    	    game_powerup = SoundFactory.createSoundFromAsset(engine.getSoundManager(), activity, "powerup_noise.ogg");
    	    game_flip = SoundFactory.createSoundFromAsset(engine.getSoundManager(), activity, "flip_sound.ogg");
    	    game_walk = SoundFactory.createSoundFromAsset(engine.getSoundManager(), activity, "move_sound.ogg");
    	    game_countdown = MusicFactory.createMusicFromAsset(engine.getMusicManager(), activity, "countdown_sound.ogg");
    	    game_gameover = MusicFactory.createMusicFromAsset(engine.getMusicManager(), activity, "game_over_sound.ogg");
    	    ff_intro = MusicFactory.createMusicFromAsset(engine.getMusicManager(), activity,"foodfrenzy_intro.ogg");

    	    main_menu_music.setLooping(true);
    	    game_music.setLooping(true);
    	    ff_intro.setVolume(10.0f);
    	}
    	catch (IOException e)
    	{
    	    e.printStackTrace();
    	    
    	}
    }
    
    private void loadFonts()
    {
        FontFactory.setAssetBasePath("font/");
        final ITexture mainFontTexture = new BitmapTextureAtlas(activity.getTextureManager(), 256, 256, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
        final ITexture bigFontTexture = new BitmapTextureAtlas(activity.getTextureManager(), 256, 256, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
        final ITexture smallFontTexture = new BitmapTextureAtlas(activity.getTextureManager(), 256, 256, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
        final ITexture optFontTexture = new BitmapTextureAtlas(activity.getTextureManager(), 256, 256, TextureOptions.BILINEAR_PREMULTIPLYALPHA);

        font = FontFactory.createStrokeFromAsset(activity.getFontManager(), mainFontTexture, activity.getAssets(), "pixelmix.ttf", 40, true, Color.WHITE, 2, Color.BLACK);
        font.load();
        
        big_font = FontFactory.createStrokeFromAsset(activity.getFontManager(), bigFontTexture, activity.getAssets(), "pixelmix.ttf", 50, true, Color.WHITE, 2, Color.BLACK);
        big_font.load();
        
        small_font = FontFactory.createStrokeFromAsset(activity.getFontManager(), smallFontTexture, activity.getAssets(), "pixelmix.ttf", 30, true, Color.WHITE, 2, Color.BLACK);
        small_font.load();
        
        opt_font = FontFactory.createStrokeFromAsset(activity.getFontManager(), optFontTexture, activity.getAssets(), "pixelmix.ttf", 50, true, Color.WHITE, 2, Color.BLACK);
        opt_font.load();
    }
    
    public void loadSplashScreen()
    {
    	BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/");
    	splashTextureAtlas = new BitmapTextureAtlas(activity.getTextureManager(), 800, 480, TextureOptions.BILINEAR);	//sets texture palette dimensions (800 x 480)
    	splash_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(splashTextureAtlas, activity, "splash_screen_test.png",0,0);
    	splashTextureAtlas.load();
    
    }
    
    
    public void unloadSplashScreen()
    {
    	splashTextureAtlas.unload();
    	splash_region = null;
    }
    
    public void unloadTitleScreen()
    {
    	titleTextureAtlas.unload();
    	title_background_region = null;
    	tap_animation_region = null;
    }
    
    public void unloadCreditsScreen()
    {
    	creditsTextureAtlas.unload();
    	credits_background_region = null;
    	square_region = null;
    }
    
    public void unloadMenuScreen()
    {
    	menuTextureAtlas.unload();
    	menu_background_region = null;
        singleplayer_region = null;
        multiplayer_region = null;
        options_region = null;
        achievements_region = null;

    }
    
    
    public void unloadSPMenuScreen()
    {
    	SPTextureAtlas.unload();
    	sp_menu_background_region = null;
    	arcade_region = null;
    	classic_region = null;

    }
     
    public void unloadOptionsScreen()
    {
    	optionsTextureAtlas.unload();
    	options_background_region = null;
    	opt_right_region = null;
        opt_left_region = null;
    }
    
    public void unloadPlayerInfoScreen()
    {
    	playerinfoTextureAtlas.unload();
    	playerinfo_background_region = null;
    }
    
    public void unloadGameOverScreen()
    {
    	gameoverTextureAtlas.unload();
    	gameover_background_region = null;
    	again_region = null;
        back_region = null;    	
    }
    
    public void unloadSoonScreen()
    {
    	soonTextureAtlas.unload();
    	soon_region = null;
        back_region = null;    	
    }
    
    public void unloadGameScreen()
    {
    	gameTextureAtlas.unload();
    }
    
    
    public void loadMenuTextures()
    {
        menuTextureAtlas.load();
        
    }
    
    
    public void unloadMenuTextures()
    {
        menuTextureAtlas.unload();
        
    }
    
    
    public void loadSPMenuTextures()
    {
        SPTextureAtlas.load();
    }
    
    
    public void unloadSPMenuTextures()
    {
        SPTextureAtlas.unload();
        
    }
    
    public void loadMPMenuTextures()
    {
        MPTextureAtlas.load();
    }
    
    
    public void unloadMPMenuTextures()
    {
        MPTextureAtlas.unload();
        
    }
        
    public void loadGameTextures()
    {
        gameTextureAtlas.load();
        
    }
    
    public void unloadMPGameTextures(){
    	MPTextureAtlas.unload();
    }
    public void unloadGameTextures()
    {
    	gameTextureAtlas.unload();
    }
    
    public void loadTitleTextures()
    {
        titleTextureAtlas.load();
        
    }
    
    
    public void unloadTitleTextures()
    {
        titleTextureAtlas.unload();
        
    }
    
    public void loadCreditsTextures()
    {
        creditsTextureAtlas.load();
        
    }
    
    
    public void unloadCreditsTextures()
    {
        creditsTextureAtlas.unload();
        
    }
    
    public void loadOptionsTextures()
    {
        optionsTextureAtlas.load();
        
    }
    
    
    public void unloadOptionsTextures()
    {
        optionsTextureAtlas.unload();
        
    }
    
    public void loadPlayerInfoTextures()
    {
        playerinfoTextureAtlas.load();
        
    }
    
    
    public void unloadPlayerInfoTextures()
    {
    	 playerinfoTextureAtlas.unload();
        
    }
    
    public void loadAchievementsTextures()
    {
        achievementsTextureAtlas.load();
        
    }
    
    
    public void unloadAchievementsTextures()
    {
    	 achievementsTextureAtlas.unload();
        
    }
    
    public void loadSoonTextures()
    {
        soonTextureAtlas.load();
        
    }
    
    
    public void unloadSoonTextures()
    {
        soonTextureAtlas.unload();
        
    }
    
    public void loadGameOverTextures()
    {
        gameoverTextureAtlas.load();
        
    }
    
    
    public void unloadGameOverTextures()
    {
    	gameoverTextureAtlas.unload();
        
    }
    
        
    /**
     * @param engine
     * @param activity
     * @param camera
     * @param vbom
     * <br><br>
     * We use this method at beginning of game loading, to prepare Resources Manager properly,
     * setting all needed parameters, so we can latter access them from different classes (eg. scenes)
     */
    public static void prepareManager(Engine engine, GameActivity activity, Camera camera, VertexBufferObjectManager vbom)
    {
        getInstance().engine = engine;
        getInstance().activity = activity;
        getInstance().camera = camera;
        getInstance().vbom = vbom;
        
    }
    
    
    public static ResourcesManager getInstance()
    {
        return INSTANCE;
        
    }
    
    
    public VertexBufferObjectManager getVertexBuffer()
    {
        return this.vbom; 
        
    }
    
}
